package cn.edu.nju.askme.action;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import cn.edu.nju.askme.model.Paper;
import cn.edu.nju.askme.service.IPaperService;

import com.opensymphony.xwork2.ActionSupport;
@Component
public class PaperShowAction extends ActionSupport{
	private String pid; 
	
	private Paper paper;
	
	private IPaperService paperService;

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	public Paper getPaper() {
		return paper;
	}

	public void setPaper(Paper paper) {
		this.paper = paper;
	}

	public IPaperService getPaperService() {
		return paperService;
	}
	@Resource
	public void setPaperService(IPaperService paperService) {
		this.paperService = paperService;
	}
	
	@Override
	public String execute() throws Exception {
		paper = paperService.checkById(Integer.parseInt(pid));
		return SUCCESS;
	}
	
}
